package controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import po.Speciality;
import service.SpecialityService;
import utils.ResUtils;

import java.util.List;
@Controller
public class SpecialityController {
    @Autowired
    private SpecialityService specialityService;

    // 获取专业列表数据
    @GetMapping("/specialitys")
    @ResponseBody
    public Object AllSpecialitys() {

        List<Speciality> res = this.specialityService.allSpeciality();

        if ( res != null) {
            return ResUtils.Success(1,"查询成功",res);
        } else {
            return ResUtils.Fail(0,"没有数据");
        }
    }
}
